/**
 * 
 */
package de.fanda.hib.data;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

/**
 * @author Frantisek Schneider
 * @version 1.0
 */

@Entity
@Table(name = "account")
public class Account
{

	@Id
	@Column
	private int			id;

	@Column
	private String		name;

	@ManyToMany(fetch = FetchType.LAZY, mappedBy = "accounts")
	private List<User>	users;

	public Account()
	{
	}

	public int getId()
	{
		return id;
	}

	public void setId(int id)
	{
		this.id = id;
	}

	public List<User> getUsers()
	{
		return users;
	}

	public void setUsers(List<User> users)
	{
		this.users = users;
	}

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}
	
	@Override
	public String toString()
	{
		return name;
	}
	

}
